package products;
enum State{NEW,LOADED,CHANGED};
public class Product {
	private String nume;
	private String description;
	private double cost;
	private State state = State.NEW;
	public Product(String nume, String description, double cost,State state) {
		this.nume = nume;
		this.description = description;
		this.cost = cost;
		this.state=state;
	}
	public String getNume() {
		return nume;
	}
	public void setNume(String nume) {
		this.nume = nume;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public double getCost() {
		return cost;
	}
	public void setCost(double cost) {
		this.cost = cost;
	}
	@Override
	public String toString() {
		return "Product [nume=" + nume + ", description=" + description
				+ ", cost=" + cost + ", state=" + state + "]";
	}
	public ProductMemento Memento()
	{
		return new ProductMemento(nume,description,cost,state);
		
	}
	public void restoreMemento(ProductMemento memento)
	{
		this.nume = memento.getNume();
		this.description = memento.getDescription();
		this.cost = memento.getCost();
		this.state = memento.getState();
	}

}
